import { defineStore } from 'pinia'
import { memberOrder } from '@/api/order'
import { ref } from 'vue'
export const useOrderGoodstStore = defineStore('orderGoods', () => {
  const Info = ref({})
  const pageData = ref({
    page: 1,
    pageSize: 10,
    orderState: 0
  })
  const setPageData = p => {
    pageData.value = p
  }
  const show = ref(false)
  const getData = async () => {
    show.value = true
    const res = await memberOrder(pageData.value)
    Info.value = res.data.result
    show.value = false
  }

  return { Info, pageData, setPageData, getData, show }
})
